<?php

class Model_Vote_History extends PhalApi_Model_NotORM {

    public function  getTotalByDay($openid,$day,$id){
        $where=[
            "openid"=>$openid,
            "DATE(ctime)"=>$day
        ];
        if($id){
            $where['userid']=$id;
        }
        return $this->getORM()
            ->where($where)
            ->count("id");
    }



    protected function getTableName($id) {
        return 'votes_History';
    }
}
